<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        console.log(a, b)  //还未定义没有值
        var a = 12, 
        b = '林更新'  //全局变量 相当于window作用域下let b=`林更新`
        function foo() {
            console.log(a, b)  // 当前作用域a仍未赋值
            var a = b = 13     //a和b赋值为13
            console.log(a, b)  
        }
        foo()
        console.log(a, b)   //a取赋值的12,b更新为13
    </script>
</body>

</html>